package com.example.message.enums;

/**
 * 优先级类型枚举
 */
public enum PriorityType {
    
    LOW(1, "低"),
    MEDIUM(2, "中"),
    HIGH(3, "高"),
    URGENT(4, "紧急");
    
    private final Integer code;
    private final String desc;
    
    PriorityType(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    
    public Integer getCode() {
        return code;
    }
    
    public String getDesc() {
        return desc;
    }
    
    public static PriorityType getByCode(Integer code) {
        for (PriorityType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
}